# -*- coding: utf-8 -*-
# @Time    : 2025/1/22 14:40
# @Author  : sjh
# @Site    : 
# @File    : main.py
# @Comment :
import subprocess
"""
python apps/calibration/detect_chessboard.py --path data/calibration/extri_data --out data/calibration/extri_data/output/calibration --pattern 9,6 --grid 0.1
python apps/calibration/calib_extri.py  --path data/calibration/extri_data --intri data/calibration/intri_data/output/intri.yml --image_id 1

"""

# 第一个命令
command_1 = [
    "python", "detect_chessboard.py",
    "--path", "data/calibration/extri_data",
    "--out", "data/calibration/extri_data/output/calibration",
    "--pattern", "9,6",
    "--grid", "0.1"
]

# 第二个命令
command_2 = [
    "python", "calib_extri.py",
    "--path", "data/calibration/extri_data",
    "--intri", "data/calibration/intri_data/output/intri.yml",
    "--image_id", "1"
]

# 使用subprocess.run运行第一个命令
result_1 = subprocess.run(command_1, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(result_1.stdout)
# 使用subprocess.run运行第二个命令
result_2 = subprocess.run(command_2, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(result_2.stdout)

